home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 526-550 / disk_530 / dme / macros / rauch.macros < prev   
Text File  |  1992-05-06  |  5KB  |  125 lines

  1. ## ...deleted stuff...
  2.  
  3. ##
  4. ##  s-return is a fast, simple <return>-like key; it will go to the
  5. ##  left-hand column of the next line, if hit on a blank line. s-return is
  6. ##  intended to be useful in some macros, primarily.
  7. ##
  8. ##  cs-return is a variation on s-return; it does an s-return on the _next_
  9. ##  line.  Again, I only use it in macros.
  10. ##
  11. ##  a-return is what is really used for the <return> key.  I created the
  12. ##  indirection in the <return> key, since there is a <return> in the DME
  13. ##  primitive support, forcing me to do $return when I mean <return>.  This
  14. ##  causes problems when there are multiple $returns (appears to be a DME
  15. ##  bug, but I'm not sure at this time; need to check sometime). a-return
  16. ##  can split the current line, and will "remember" your indentation if you
  17. ##  are on a blank line.
  18. ##
  19. ##  Plain return is what the <return> maps to, of course.  Uses a-return.
  20. ##
  21. ##
  22. map s-return    (last split firstnb down)
  23. map cs-return    (down s-return)
  24. map a-return    (split set col \$colno firstnb ifelse x=1 (if !r (set col
  25. \$colno) ) (set col \$colno) down first while x<\$col (` ') while c=32 (del) )
  26. map return    (a-return)
  27. # map return    (ping 0 split firstnb if x=1 (if r (pong 0) ) down insline `*'
  28. join bs del)
  29.  
  30.  
  31. ##
  32. ##  these provide some (very limited) "auto formatting."
  33. ##
  34. ##  Note that for each formatting key, the alt key must be held.  This is
  35. ##  simply because I use DME for various things, and at the moment don't
  36. ##  want to contend with multiple config files for different things.
  37. ##
  38. ##  a-[ is an "auto brace".  It will format braces according to my taste. I
  39. ##  _could_ have made it a-{, instead of a-[, but I don't really need
  40. ##  square brackets formatted much, and don't want to have to push both alt
  41. ##  & shift to do this...
  42. ##
  43. ##  a-] is another "auto brace"
  44. ##
  45. ##  a-; is an "auto semicolon."  If the previous line was blank, if we are
  46. ##  at the top of the file, or the previous line ended with another
  47. ##  semicolon, this just tacks a ; on the end of the current line and moves
  48. ##  down a line (since DME doesn't have an "and" for its expressions, I had
  49. ##  to duplicate code for all of these cases; thus the inspiration for the
  50. ##  <s-return>, which makes this much simpler).  If there is a previous
  51. ##  line has anything on it, and ends with anything other than a ;, a-;
  52. ##  will do as before, but will also un-indent one level.  This isn't
  53. ##  really an entirely satisfactory representation.  One could, of course,
  54. ##  keep on adding special cases for the end of the previous line, up
  55. ##  until one hits DME's 255 char limit for a command string...
  56. ##  (Unfortunately, a-; is currently right up near the upper limit...
  57. ##  Perhaps more work could be done to offload some of the junk to other
  58. ##  keys...  Presently, if the previous line ends with { or /, this key
  59. ##  will unindent.)
  60. ##
  61. ##  s-nk1 will put a `**' in the current column, REPACING wahtever was
  62. ##  there before.  It also drops down a line.  Useful for putting in
  63. ##  comment-marker columns (a variation (s-nk2), putting in `##' was used
  64. ##  for writing these comments...).  A possible variation would be to have
  65. ##  spaces (say, 4 of'em) inserted so that `**' won't overwrite anything.
  66. ##
  67. ##  a-nk1 will "undo" a-nk1's work.
  68. ##
  69. ##  sa-nk1 will move the current line to be indented aligned with the
  70. ##  current cursor position.  It will then, like other -nk1 keys, move down
  71. ##  one line.
  72. ##
  73. ##  s-nk3 puts a double-semicolon (;;) column in, as s-nk1 does with
  74. ##  asterisks.
  75. ##
  76. ##
  77.  
  78. map a-[     (last a-return `{' split firstnb down tab)
  79. map a-]     (last a-return $s-tab `}')
  80. map a-; (set col \$colno last if l (col \$col) `;' ifelse t (s-return) (up last
  81. ifelse l (cs-return) (left ifelse c=59 (cs-return) (ifelse c<=32 (cs-return)
  82. (ifelse c>126 (cs-return) (ifelse c=125 (cs-return) (cs-return backtab))))))
  83.  
  84.  
  85. map s-nk1    (del del `**' left left down)
  86. map a-nk1    (del del `  ' left left down)
  87. map sa-nk1    (insline `*' join bs del down)
  88. map s-nk3    (del del `;;' left left down)
  89.  
  90.  
  91.  
  92. ##
  93. ##  These give me cursor control more like Uedit's.  Not exactly the
  94. ##  same, but enough to keep me happy for now.
  95. ##
  96. ##
  97. ##  The nk6 key was something of a pain to write, like the return key
  98. ##  above, but it got done...yay!  (sorta...DME needs a break statement or
  99. ##  else 'boolean' operators (and, or, etc.) for its loops.
  100. ##
  101. ##
  102.  
  103. map (nk8)   (up)
  104. map (nk2)   (down)
  105. map (nk4)   (wleft)
  106. map (nk6)   (wleft wright if r (down first while r (down)) while !c<=32 (right))
  107.  
  108. map (s-nk8) (up)
  109. map (s-nk2) (down)
  110. map (s-nk4) (left)
  111. map (s-nk6) (right)
  112.  
  113. map (c-nk8) (pageup)
  114. map (c-nk2) (pagedown)
  115. map (c-nk4) (first)
  116. map (c-nk6) (last)
  117.  
  118. ## ...deleted stuff...
  119.  
  120. map f10 arpload
  121. map s-f10 (newwindow arpload)
  122.  
  123. ## ...deleted stuff...
  124.  
  125.